package cn.wolfcode.wms.domain;


import cn.wolfcode.wms.util.JsonUtil;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

@Getter@Setter
public class Product extends BaseDomain {

    private String name;//商品名称
    private String sn;//商品编号
    private BigDecimal costPrice;//商品成本价
    private BigDecimal salePrice;//商品零售价
    private String imagePath;//商品图片路径
    private String intro;//备注

    //打破第三范式
    private Long brandId;//品牌ID
    private String brandName;//品牌名称

    public String getJsonString(){
        Map<String,Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("sn",sn);
        map.put("brandName",brandName);
        map.put("costPrice",costPrice);
        map.put("salePrice",salePrice);
        map.put("remark",intro);
        return JsonUtil.toJsonString(map);
    }

}
